// 创建路由器

// 引入Vue
import Vue from 'vue'
// 引入路由
import VueRouter from 'vue-router'
// 使用插件
Vue.use(VueRouter)

// 引入组件
import Teacher from '@/pages/Teacher'
import Student from '@/pages/Student'
import News from '../pages/News'
import Message from '../pages/Message'
import Detail from '../pages/Detail'

// 创建并暴露一个路由
export default new VueRouter({
    routes:[
        {
            path:'/Teacher',
            component: Teacher
        },
        {
            name:'xuesheng',
            path: '/Student',
            component: Student,
            children:[
                {
                    path: 'News',
                    component: News,
                    children:[
                        {
                            name:'xiangqing',
                            path:'Detail/:id/:title',
                            component: Detail
                        }
                    ]
                },
                {
                    path: 'Message',
                    component: Message
                },
            ]
        }
    ]
})
